package org.jeecg.modules.room.controller;

import javax.servlet.http.HttpServletRequest;

import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.room.entity.RoomStatus;
import org.jeecg.modules.room.service.IRoomStatusService;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;

import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.room.vo.RoomStatusVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @Description: 房态表
 * @Author: jeecg-boot
 * @Date:   2023-12-04
 * @Version: V1.0
 */
@Api(tags="房态表")
@RestController
@RequestMapping("/room/roomStatus")
@Slf4j
public class RoomStatusController extends JeecgController<RoomStatus, IRoomStatusService> {
	@Autowired
	private IRoomStatusService roomStatusService;
	
	/**
	 * 分页列表查询
	 *
	 * @param roomStatusVo
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	//@AutoLog(value = "房态表-分页列表查询")
	@ApiOperation(value="房态表-分页列表查询", notes="房态表-分页列表查询")
	@GetMapping(value = "/list")
	public Result<IPage<RoomStatusVo>> queryPageList(RoomStatusVo roomStatusVo,
													 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
													 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
													 HttpServletRequest req) {
		QueryWrapper<RoomStatusVo> queryWrapper = QueryGenerator.initQueryWrapper(roomStatusVo, req.getParameterMap());
		Page<RoomStatusVo> page = new Page<RoomStatusVo>(pageNo, pageSize);
		IPage<RoomStatusVo> pageList = roomStatusService.selectRoomStatusList(page, queryWrapper);
		return Result.OK(pageList);
	}

}
